package com.firefly.admin.common.vo;

import lombok.Data;
import lombok.ToString;
import com.firefly.admin.system.entity.FySystemMenu;
import com.firefly.admin.system.entity.FySystemUser;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.Date;
import java.util.List;

@ToString
@Data
public class LoginUser implements UserDetails {

    //用户名
    private String userName;
    //登录密码
    private String loginPwd;
    //用户信息
    private FySystemUser fySystemUser;
    //登录时间
    private Date loginTime;
    //登录token
    private String token;
    //权限列表
    private List<FySystemMenu> systemMenuList;

    private Collection<? extends GrantedAuthority> authorities;


    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return authorities;
    }

    @Override
    public String getPassword() {
        return loginPwd;
    }

    @Override
    public String getUsername() {
        return userName;
    }

    @Override
    public boolean isAccountNonExpired() {
        return false;
    }

    @Override
    public boolean isAccountNonLocked() {
        return false;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return false;
    }

    @Override
    public boolean isEnabled() {
        return false;
    }
}
